﻿using UnityEngine;
using System.Collections;

public class CraftMaterialAmount
{
    public readonly CraftMaterial material;
    public int amount;

    public CraftMaterialAmount(CraftMaterial p_material)
    {
        material = p_material;
        amount = 1;
    }

    public CraftMaterialAmount(CraftMaterial p_material, int p_amount)
    {
        material = p_material;
        amount = p_amount;
    }

    public void Add(int p_amount)
    {
        amount += p_amount;
    }

    public bool Subtract(int p_amount)
    {
        if (amount - p_amount >= 0)
        {
            amount -= p_amount;
            return true;
        }
        else
        {
            return false;
        }
    }

}
